#ifndef UVectorH
#define UVectorH
#include "stdafx.h"

struct TextureCoords {
	GLfloat i,j;
	TextureCoords ( GLfloat I, GLfloat J )
			: i ( I ), j ( J ) {};
};

struct TVector {
public:
	GLfloat x;
	GLfloat y;
	GLfloat z;
	TVector();
	TVector ( GLfloat x, GLfloat y, GLfloat z );
	TVector& Normalize();
	TVector Normal();
	float Length();
	GLfloat operator <= ( const TVector& that ) const; //Distance to other vector
	TVector operator - ( const TVector& vec ) const;
	TVector& operator -= ( const TVector& vec );
	TVector operator + ( const TVector& vec ) const;
	TVector& operator += ( const TVector& vec );
	TVector operator * ( const TVector& vec ) const; //Cross product
	TVector operator * ( const int factor ) const;
	TVector& operator *= ( const int factor );
	TVector operator * ( const float factor ) const ;
	TVector& operator *= ( const float factor ) ;
	TVector operator / ( const int i ) const;
	float   operator % ( const TVector& V2 ) const; //Dot product
	bool operator == ( const TVector& vec ) const;
};

struct TTriangle {
	TVector v1, n1, uv1,
	        v2, n2, uv2,
	        v3, n3, uv3;
	TTriangle();
};

typedef std::vector<TTriangle> TTriangleList;

#endif
